﻿using System;
using System.Collections.Generic;
using System.Text;

namespace designmodule.structuralmodule.Proxy
{
    public abstract class Subject
    {
        public abstract void Request();
    }

    public class RealSubject:Subject
    {
        public override void Request()
        {
            throw new NotImplementedException();
        }
    }

    public class Proxy:Subject
    {
        private RealSubject RealSubject { get; set; }
        public override void Request()
        {
            if (RealSubject == null)
            {
                RealSubject=new RealSubject();
            }
            RealSubject.Request();
        }
    }
}
